home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1996-02-22 | 1.4 KB | 48 lines | [TEXT/3PRM] |
- implementation module resources;
-
- from mac_types import Handle,Toolbox;
-
- // system 7.0 or later
- HOpenResFile :: !Int !Int !{#Char} !Int !Toolbox -> (!Int,!Toolbox);
- HOpenResFile vRefNum dirID fileName permission t
- = code (vRefNum=R2W,dirID=L,fileName=S,permission=D1,t=U)(refNum=W,t2=Z){
- instruction 0x1F01 | move.b d1,-(sp)
- instruction 0xA81A
- }
-
- // system 7.0 or later
- HCreateResFile :: !Int !Int !{#Char} !Toolbox -> Toolbox;
- HCreateResFile vRefNum dirID fileName t = code (vRefNum=W,dirID=L,fileName=S,t=U)(t2=Z){
- instruction 0xA81B
- }
-
- CloseResFile :: !Int !Toolbox -> Toolbox;
- CloseResFile refNum t = code (refNum=W,t=U)(t2=Z){
- instruction 0xA99A
- }
-
- AddResource :: !Handle !{#Char} !Int !{#Char} !Toolbox -> Toolbox;
- AddResource theData theType theID name t = code (theData=L,theType=A1,theID=D1,name=A0,t=U)(t2=Z){
- instruction 0x2F29 0x0008 | move.l 8(a1),-(sp)
- instruction 0x3F01 | move.w d1,-(sp)
- instruction 0x4868 0x0007 | pea 7(a0)
- instruction 0xA9AB
- }
-
- ResError :: !Toolbox -> (!Int,!Toolbox);
- ResError t = code (t=R2U)(res_error=W,t2=Z){
- instruction 0xA9AF
- }
-
- Get1Resource :: !{#Char} !Int !Toolbox -> (!Handle,!Toolbox);
- Get1Resource theType index t = code (theType=R4A0,index=D1,t=u)(handle=L,t2=Z){
- instruction 0x2F28 0x0008 | move.l 8(a0),-(sp)
- instruction 0x3F01 | move.w d1,-(sp)
- instruction 0xA81F
- }
-
- RemoveResource :: !Handle !Toolbox -> Toolbox;
- RemoveResource handle t = code (handle=L,t=U)(t2=Z){
- instruction 0xA9AD
- }
-